rel-edit

From Microformats Wiki
Jump to navigation Jump to search

This article is a stub. You can help the microformats.org wiki by expanding it.

rel=edit is for linking to a page to a URL that a browser can load for the user to edit that page.

Definition

rel=edit can be applied to link or a tags, like so:

<link rel="edit" href="https://example.com/edit/page-name" />
<a rel="edit" href="https://example.com/edit/page-name">Edit this page</a>

A rel=edit parser should look for rel=edit links on the page and take the first one found.

The following query selector could be used to identify a candidate rel=edit link per the above description:

document.querySelector("link[rel=edit], a[rel=edit]")

When to add a rel=edit relation to a link

rel=edit must only be published on a page if the user can access the edit page without additional authentication. This is important so that rel=edit links take a user directly to an editing interface.

A rel=edit relation could be added to a page if the page is editable:

  • Publicly (i.e. a page on an open wiki), or;
  • To the user viewing the page because they are signed in (i.e. a blog post on a private site where the user is signed in as admin).

Use Cases

rel=edit offers a standard way to indicate a page is editable by the user.

This relation then be identified by a browser, browser extension, or a bookmarklet and used to both infer that a page is editable and autodiscover the page to link to for the user to edit the page.

Publishers

Websites supporting rel=edit:

Tools

Tools that users can use to edit pages marked up with rel=edit:

Libraries

Libraries developers or extensions can use to detect rel=edit:

Prior Art

Earlier proposal

rel=edit was raised in Bug 19068 “Add rel="edit" to list of defined types” in the W3C public Bugzilla to the WHAT WG:

rel="edit" indicates a link that can be used to edit the current resource, e.g., if it's a wiki. It's been proposed by the Universal Edit Button project <http://universaleditbutton.org/>. That documents a number of sites using either rel="edit", or the older poorly-conceived <link rel="alternate" type="application/x-wiki">:

http://universaleditbutton.org/Universal_Edit_Button#Sites_with_Universal_Editing_Button

Users of rel="edit" include MediaWiki, and therefore Wikipedia. As far as implementation goes, there are extensions written for Firefox, Opera, and Chrome. It seems like potentially useful semantics, although only for a fairly narrow class of sites (wikis and CMSes). I'm pretty sure the level of implementation and deployment exceeds some currently specced rel values, like tag, so I don't see why this shouldn't be in the spec. Are there any specific standards you'd like to see that this doesn't meet?

As of May 10th, 2025, Wikipedia does not publish a rel=edit on the main Edit link on pages, but still publishes the `application/x-wiki` syntax.

rel=alternate type=application/x-wiki

MediaWiki supports the following syntax to indicate that the linked resource lets you edit the current page:

 <link rel="alternate"
   type="application/x-wiki"
   title="Welcome to edit this page!"
   href="wiki?edit=myEditLink"/>

This syntax is parsed by the Universal Edit Button.

Because of its support in the MediaWiki engine, this markup is on Wikipedia pages.

With that said, this syntax does not extend to anchor links, unlike the proposed rel=edit. The rel=alternate syntax means you have to add another tag instead of marking up existing, human-clickable link on the page via a rel=edit on an anchor.

rel=edit in Atom

RFC 5023 - The Atom Publishing Protocol describes a rel=edit relation in 11.1 as:

This specification adds the value "edit" to the Atom Registry of Link Relations (see Section 7.1 of [RFC4287]). The value of "edit" specifies that the value of the href attribute is the IRI of an editable Member Entry. When appearing within an atom:entry, the href IRI can be used to retrieve, update, and delete the Resource represented by that Entry. An atom:entry MUST NOT contain more than one "edit" link relation.

rel=EditURI in WordPress

WordPress has support for rel=EditURI. The microformats wiki defines the relation in rel-edituri as:

This relationship is used in Wordpress to denote the location of the xml-rpc gateway that allows external editors to be used.

Here is an example of the syntax:

<link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://example.com">

Background

Many sites offer public editing capabilities for web pages, often for authenticated users, with an approval process, or moderation to review edits. Such editing capabilities are common for wikis and technical documentation websites. For example, Wikipedia pages can be edited.

Every site has its own way of indicating that a page is editable. Among the sites that allow editing there is inconsistency in where edit links are placed and the language used. For example, Wikipedia uses “Edit” whereas the GitHub documentation uses “Make a contribution”.

Open questions

Public vs. private distinction

rel=edit should only be applied to links that the current user can use to edit a page.

If rel=edit is applied to a link on a public page, it means anyone can contribute to the page. This may be the case for a wiki or a documentation site, for example. If rel=edit is applied to a link on a private page, it means that anyone viewing that page can edit it.

rel=edit implies a page is editable. Users should not encounter a rel=edit link that they have no means to access.

A good guideline is:

  • if a page has an existing human interface element like a clickable Edit link or pencil (✏️) icon or emoji, then that link should be marked up with rel=edit. Otherwise if a page does not show any visual indicator that it can be edited, avoid using rel=edit.

See Also

  • User:Tantek's brainstorm of a wiki based on static pages and HTTP headers notes:

    a page could link to its editing interface/version/query parameter with a rel link as well, e.g. rel=edit, which has been previously proposed as part of Universal Edit Button: links for AJAX-driven edits but could be used for server-based editing state as well. E.g. href="?edit=1". Again this might be best sent as an HTTP Link Header.

    Emphasis added.